package com.ourfox.a4.services;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ourfox.a4.bean.test.Test;
import com.ourfox.a4.bean.test.Test2;
import com.ourfox.a4.commons.exception.PortalException;
import com.ourfox.a4.commons.services.GenericServiceImpl;
import com.ourfox.a4.dao.test.Test2Dao;
import com.ourfox.a4.dao.test.TestDao;
import com.ourfox.a4.services.test.Test2Service;
import com.ourfox.a4.services.test.TestService;

/**
 * 
 * @Description: 测试类
 * @author xiujin.luo@gmail.com
 * @date 2013-4-11 上午2:16:31 
 * @version V1.0.0
 */
@Service
public class Test2ServiceImpl extends GenericServiceImpl<Test2, Integer, Test2Dao>
		implements Test2Service {

	@Autowired
	private Test2Dao test2Dao;
	
	@Autowired
	private TestDao testDao;
	
	@Autowired
	private TestService testService;

	public Test2Dao getDAO() {
		return test2Dao;
	}

	public void testTx(int code) throws PortalException {
		Test bean = new Test();
		bean.setCode(code);
		bean.setName("testTx" + code);
		bean.setValue("testTx.code" + code);
		this.testDao.add(bean);
		
		Test2 bean2 = new Test2();
		bean2.setCode(code);
		bean2.setName("testTx" + code);
		bean2.setValue("testTx.code" + code);
		
		this.test2Dao.add(bean2);
		
		
	}
	
	public void testTx2(int code) throws PortalException {
		Test bean = new Test();
		bean.setCode(code);
		bean.setName("testTx" + code);
		bean.setValue("testTx.code" + code);
		this.testService.add(bean);
		
		Test2 bean2 = new Test2();
		bean2.setCode(code);
		bean2.setName("testTx" + code);
		bean2.setValue("testTx.code" + code);
		
		this.test2Dao.add(bean2);
		
		
	}

}
